package com.linglingC.controller;


import com.linglingC.pojo.*;
import com.linglingC.service.EmplyeeService;
import com.linglingC.service.ItemChargeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;

@Slf4j
@RestController
public class ItemChargeContrroller {

    @Autowired
    private ItemChargeService itemChargeService;


    @GetMapping("/itemChargeFindAll")
    public Result itemChargeFindAll(@RequestParam(defaultValue = "1") Integer page,
                                 @RequestParam(defaultValue = "10") Integer pageSize
                                             ){
        log.info("收费表分页查询:{} {}",page,pageSize);

        PageBean pageBean=itemChargeService.findAll(page,pageSize);

        return Result.success(pageBean);
    }


    @PostMapping("/addItemCharge")
    public Result addItemCharge(@RequestBody ItemChargeAdd itemChargeAdd){

        log.info("物业项目收费单生成:{}",itemChargeAdd);

        itemChargeService.addItemCharge(itemChargeAdd);

        return Result.success();
    }
}
